package study.aop;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class AopAspect3 {

    @Pointcut("execution(public * study.aop.AopController.test2(..))")
    public void pointcut() {

    }

    @Around("pointcut()")
    public Object doAround(ProceedingJoinPoint pjp) throws Throwable {
        Object[] args = pjp.getArgs();
        Pa pa = (Pa) args[0];
        pa.setName("修改后的执行");
        Object proceed = pjp.proceed();
        return proceed;
    }

}
